/*
============================================================================
 Name        : BlockLogo.h
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : CBlockLogo declaration
============================================================================
*/

#ifndef BLOCKLOGO_H
#define BLOCKLOGO_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>

#include "Block.h"
#include "ImageTool.h"
// CLASS DECLARATION
class CFbsBitmap;
class CPeriodic;
/**
*  CBlockLogo
* 
*/

//#ifdef MOBILEMARKET
class CBlockLogo : public CBlock, MImageToolObserver
{
public:
	~CBlockLogo();
	static CBlockLogo* NewL();
	static CBlockLogo* NewLC();

private:
	CBlockLogo();
	void ConstructL();

public:
	virtual void ScaleCompleted();

public:
	void CancelTimer();
	void StartTimer();
	
public:
	void Draw(CFbsBitGc& g) const;

	void DrawCircle(CFbsBitGc& g)const;

	TInt OneSecond( );

	void OnMouseUp(const TPoint& aPt);
	
	static TInt OnRedraw(TAny* aAny);
	static TInt OnSaveBitmap(TAny* aAny);
	static TInt OnGetBitmap(TAny* aAny);

	void BeforeBack();
	void OnKeyDown(TInt keyCode);
	void ConvertToAlpha( CFbsBitmap *amgToBrighten) const;
	
	void SizeChanged();

	TBool ReadData(const TDesC8& aData);
	void WriteData(TDes8& aBuf);
	TInt GetDataLength();
	TInt16 GetDataType();

	void ReleaseData();
	void GetLogoImage();
	
//	virtual void ReadLogin(const TDesC8& aData);
private:
	CFbsBitmap*		iBmpLogo;
	CFbsBitmap*		iBufferedBitmap;
	CFbsBitmapDevice*	iBitmapDevice;
	CFbsBitGc*			iBitmapGc;
	//CFbsBitmap*		iBmpCircle;
	TInt			iCount;

	CPeriodic* m_AnimationTimer;
	CPeriodic* m_GetLogoTimer;
	CPeriodic* m_ScaleTimer;

	CImageTool* m_imgTool;

	CBlock* m_pBlockNext;
	TInt	iStep;

	CFbsBitmap*	iWhiteBall;
	CFbsBitmap*	iSmallBall;
	CFbsBitmap*	iBigBall;
	CFbsBitmap*	iWhiteBallMask;
	CFbsBitmap*	iSmallBallMask;
	CFbsBitmap*	iBigBallMask;
	TRect	iButtonRect;
};
//#endif //MOBILEMARKET

#endif // BLOCKLOGO_H
